package com.gulimall.ssoserver.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

@Controller
public class HelloController {

    @ResponseBody
    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

    @GetMapping("/employees")
    public String list(Model model){
        List<String> employees =new ArrayList<>();
        employees.add("张飞");
        employees.add("关羽");
        model.addAttribute("employees",employees);
        return "list";
    }
}
